public class Test {

	public static void main(String[] args)
	{
		//Init des gesamt Memory mit einer HD
			System.out.println("-------init--------");
			System.out.println("freier Speicher nach init:");	
			MemoryManager test = new MemoryManager();
			//Ausgabe des Leeren Speichers
			System.out.println(test.freemem());
			
		//TestFaelle LOAD
			System.out.println("-------insert--------");
			
			//insert DVDR in DVDDrive
			test.insert(new DVDDrive(), new DVDR());
			System.out.println("insert DVDR:\n"+test.freemem()+"\n");
			
			//Fehlerfall: insert CDR in Blueray
			test.insert(new BlueRayDisc(), new CDRW());
			System.out.println("insert CDR in Blueray:fail!!!\n" +test.freemem()+"\n");
			
			//insert blueray 
			test.insert(new BlueRayDrive(), new DVDR());
			System.out.println("insert BlueRayDisc\n" +test.freemem()+"\n");
			
			//insert 2.blueraydisc : !!laufwerk schon belegt!!
			test.insert(new BlueRayDrive(), new BlueRayDisc());
			System.out.println("insert BlueRayDisc:fail!!!\n" +test.freemem()+"\n");
			
			//insert new Device
			test.insert(new USBDrive(), new DVDR());
			test.insert(new USBPort(), new USBDrive());
			test.insert(new USBDrive(), new DVDR());
			System.out.println("insert USBDrive mit DVDR\n" +test.freemem()+"\n");
			
		//TestFaelle unload
			System.out.println("-------out--------");
			test.unload(new DVDDrive(), new DVDR());
			System.out.println("remove DVDR:\n" +test.freemem()+"\n");
			
			test.unload(new DVDDrive(), new DVDR());
			System.out.println("remove DVDR:Fail\n" +test.freemem()+"\n");
		//Use 
			System.out.println("-------use--------");
			test.use(new HardDisc(), 12);
			System.out.println("remove 12 MB of HD:\n" +test.freemem()+"\n");
			
			test.use(new BlueRayDrive(), 10);
			System.out.println("remove 10 MB of BlueRayDrive:\n" +test.freemem()+"\n");
			
			test.use(new DVDDrive(), 8);
			System.out.println("remove 8  MB of DVDDrive:fail!!!\n" +test.freemem()+"\n");
			
			test.use(new HardDisc(), 500000);
			System.out.println("remove 500000  MB of hd:fail!!!\n" +test.freemem()+"\n");
			
			test.use(new USBDrive(), 50);
			System.out.println("remove 50  MB of USBDrive\n" +test.freemem()+"\n");
	
			
	}
}
